<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
    <link href="<s:url value='../css/style.css'/>" rel="stylesheet" type="text/css"/>
    <style>
		body {	
			background-color: #e8eefa;
			font-family: Verdana;	
			font-size: 11px;	
			line-height: 1em;	
			color: #000000;
		}
    	td {
    		white-space:nowrap;
    	}
    </style>
    <title><s:property value="#title"/></title>
   	<s:head theme="ajax"/>
</head>

<script language="javascript" type="text/javascript">
function formSubmit(){
	document.forms[0].submit();
}
function formCancelar(){
	document.forms[0].action = "indexCat.action";
	document.forms[0].submit();
}
</script>

<base>

<body>

<center>
<s:form theme="simple" action="crudCat_save" name="categoria" method="post">
<table width="400" cellpadding="0" cellspacing="0" border="0">
<tr>
	<td width="15" height="16" align="right"><img src="../images/box-form-top-left.gif"></td>
	<td height="16" align="right" background="../images/box-form-up.gif" style="background-repeat: repeat-x"></td>
	<td width="15" height="16" align="left"><img src="../images/box-form-top-right.gif"></td>
</tr>
<tr>
	<td width="15" align="right" background="../images/box-form-middle-left.gif" style="background-repeat: repeat-y"></td>
	<td style="background-color: #f6f8f7;" align="center">
		<table width="100%" cellpadding="1" cellspacing="0" border="0">
		<tr>
			<td colspan="2"><img src="../images/titulo-form-cadastro-categorias.gif"></td>
		</tr>
		<tr>
			<td colspan="2" align="center"><span style="color: b01e08;"><br /><b>Os campos com asterisco são obrigatórios!</b><br /><br /></span></td>
		</tr>
		<s:if test="hasActionErrors()">
		<tr>
			<td align="center">
				<table width="422" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td width="422" height="26"><img src="../images/caixa-erro-top.gif" /></td>
				</tr>
				<tr>
					<td background="../images/caixa-erro-middle.gif" style="background-repeat: repeat-y;">
						<table width="95%" cellpadding="8" cellspacing="0" border="0">
						<tr>
							<td><s:actionerror/><s:actionmessage/></td>
						</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td width="422" height="18"><img src="../images/caixa-erro-bottom.gif" /></td>
				</tr>
				</table>
			</td>
		</tr>
		</s:if>
		<tr>
			<td align="center">
			    <!-- FORMULÁRIO -->
			    <table cellpadding="2" cellspacing="0" border="0">
			    <tr>
					<td>
					    <s:textfield theme="ajax" cssClass="inputTexto" name="categoria.nmCategoria" required="true" requiredposition="left" value="%{categoria.nmCategoria}" label="%{getText('label.nmCategoria')}" size="40"/>
						<s:select label="%{getText('label.statusCategoria')}" name="categoria.statusCategoria" theme="ajax" cssClass="inputTexto" list="status" listKey="valor" listValue="label" />
						<s:hidden name="categoria.cdCategoria" value="%{categoria.cdCategoria}"/>
					</td>	
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><br />
			    <!-- BOTÕES -->
			    <table width="160" cellpadding="3" cellspacing="0" border="0">
			    <tr>
			    	<td colspan="2" align="center"><img src="../images/button-separator.gif" style="cursor: pointer;" /></td>
			    </tr>
			    <tr>
			    	<td width="80" align="center"><s:submit type="image" theme="simple" src="../images/botao-salvar.gif"/></td>
			    	<td width="80" align="center"><img src="../images/botao-cancelar.gif" style="cursor: pointer;" onclick="formCancelar();" /></td>
			    </tr>
			    </table>
			</td>
		</tr>
		</table>
	</td>
	<td width="15" align="left" background="../images/box-form-middle-right.gif" style="background-repeat: repeat-y"></td>
</tr>
<tr>
	<td width="15" height="16" align="right"><img src="../images/box-form-bottom-left.gif"></td>
	<td height="16" align="left" background="../images/box-form-bottom.gif" style="background-repeat: repeat-x"></td>
	<td width="15" height="16" align="left"><img src="../images/box-form-bottom-right.gif"></td>
</tr>
</table>

</s:form>
</center>

</body>
</html>